//stack.cpp
/********************************************************************************
*																				*
*	Author:			Jared Szechy												*
*	Assignment:		Assignment 6												*
*	Class:			CPS-151														*
*	Instructor:		V. Starkley													*
*	Due Date:		October 13													*
*																				*
*	This file implements the stack class.										*
*																				*
********************************************************************************/
template <class ItemType>
Stack<ItemType>::Stack()
{
	top = -1;
}

template <class ItemType>
void Stack<ItemType>::MakeEmpty()
{
	top = -1;
}

template <class ItemType>
bool Stack<ItemType>::IsEmpty()
{
	return top == -1;
}

template <class ItemType>
bool Stack<ItemType>::IsFull()
{
	return top == MAX_ITEMS+ 1;
}

template <class ItemType>
bool Stack<ItemType>::Push(ItemType item)
{
	if (top == MAX_ITEMS + 1)
		return false;
	else
	{
		top++;
		items[top] = item;
		return true;
	}
}

template <class ItemType>
bool Stack<ItemType>::Pop(ItemType& item)
{
	if (top == -1)
		return false;
	else
	{
		item = items[top];
		top--;
		return true;
	}
}
